package cn.edu.zzu.demo01Thread;

public class ThreadDemo02 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"==>"+" Thread操作了 "+i);
        }
    }

    public static void main(String[] args) {
        new Thread(new ThreadDemo01(),"子线程").start();

        for (int i = 0; i < 20; i++) {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"==>"+" Main操作了  "+i);
        }

    }
}
